package org.bangumibuddy.config;

import org.bangumibuddy.service.Impl.BlankMoiveScrapingService;
import org.bangumibuddy.service.Impl.TmdbMoviceScrapingService;
import org.bangumibuddy.service.MovieScrapingService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MovieScrapingServiceConfig {

    @Value("${tmdb.apikey}") String apiKey;

    @Bean
    public MovieScrapingService MovieScrapingService(@Value("${config.scrapingservice}")String scrapingservice) {

        if(scrapingservice.equals("tmdb"))
            return new TmdbMoviceScrapingService(apiKey);

        return new BlankMoiveScrapingService();
    }
}
